import { http } from "@/utils/http";
import baseUrlProxy from "@/api/baseUrlProxy";

export type OnlineItem = {
  address: string;
  browser: string;
  dept: string;
  ip: string;
  key: string;
  loginTime: string;
  nickName: string;
  userName: string;
};

export type ResultOnlineUser = {
  content: OnlineItem[];
  totalElements: number;
};

export const getOnlineUserList = (data?: object) => {
  return http.request<ResultOnlineUser>("get", baseUrlProxy + "/auth/online", {
    params: data
  });
};
export const delOnlineUserList = (data?: object) => {
  return http.request<any>("delete", baseUrlProxy + "/auth/online", {
    data
  });
};
export const exportOnlineUserList = (data?: object) => {
  return http.request<any>(
    "get",
    baseUrlProxy + "/auth/online/download",
    { params: data },
    { responseType: "blob" }
  );
};
